//
//  UIView+Extension.swift
//  WeiboProject
//
//  Created by amos on 16/1/18.
//  Copyright © 2016年 itheima. All rights reserved.
//

import UIKit

@IBDesignable extension UIView{
    
    @IBInspectable var borderWidth: CGFloat{
        set{
            self.layer.borderWidth = newValue
        }
        get{
            return self.layer.borderWidth
        }
    }
    
    @IBInspectable var borderColor: UIColor{
        set{
            self.layer.borderColor = newValue.CGColor
        }
        get{
            return UIColor(CGColor: self.layer.borderColor!)
        }
    }
    
    @IBInspectable var cornerRadius: CGFloat{
        set{
            self.layer.cornerRadius = newValue
            
            if newValue > 0{
                self.layer.masksToBounds = true
            }
        }
        get{
            return self.layer.cornerRadius
        }
    }

    
}